<template>
 <van-nav-bar
  title="通知详情"
  left-text="返回"
  left-arrow
  @click-left="onClickLeft"
/>
  <div class="newItem_parent">
    <div class="newItem"  >
       <p style="font-size:16px">{{newsList.list.noticeTitle}}</p>
       <p><van-tag color="#ffe1e1" text-color="#ad0000">发布人:{{newsList.list.founder}}</van-tag>&nbsp;&nbsp;
            <span style="font-size:12px" class="time">{{newsList.list.creationTime}}</span>&nbsp;&nbsp;
        </p>
        </div>
        <div class="textPar">
            <div class="img"><img :src="'http://124.93.196.45:8087/prod-api/'+newsConList.conList.imagersUpload" alt=""></div>
        <span class="text" v-html="newsConList.conList.releaseStatus" style="text-indent:2em;"></span>
        </div>
    </div>

</template>
<script setup>
 import { onMounted, reactive,ref } from "vue-demi"
 import { newsQuery,newsQueryById } from "../model/news"
    import { useRoute } from "vue-router"
    let useRout = useRoute()
 let newsList = reactive({
        list:{}
    })
let newId = ref("")
let newsConList = reactive({
        conList:{}
    })
const onClickLeft = () => history.back();
 onMounted (() => {
        newsQuery({},{
  Authorization:window.localStorage.getItem("token")
        }).then(res => {
            console.log(res);
            newId.value = res.data.rows.id 
             newsList.list = res.data.rows.filter(item => item.id == useRout.params.id)[0]
            console.log(newsList.list);
        })
        newsQueryById(useRout.params.id,{
  Authorization:window.localStorage.getItem("token")
        }).then(res => {
            console.log(res);
            newsConList.conList = res.data.data
      
        })
    })

</script>

<style lang="scss" scoped>
 .newItem_parent{
      
.newItem{
    padding: 10px;
    border-bottom:1px solid gainsboro;
    width: 320px;
    margin-left: 20px;
   

    }
}
.time{
    color: gray;
}
.textPar{
    padding: 10px;
}
.img{
    height: 200px;
    border:1px solid gainsboro;
    img{
        width: 100%;
        height: 100%;
    }
}
</style>